<?php

namespace models;

/**
 * @Entity
 * @Table(name="user")
 */
class User {
	/**
	 * @Id
	 * @Column(type="integer")
	 */
	protected $id = null;
	
	public function getId() { return $this->id; }
	
	/**
	 * @Column(name="login", type="string", length=50, unique=true, nullable=false)
	 */
	protected $login;
	
	public function getLogin() {
		return $this->login;
	}
	
	/**
	 * @Column(name="first_name", type="string", length=100, unique=false, nullable=false)
	 */
	protected $firstName;
	
	public function getFirstName() {
		return $this->firstName;
	}
	
	
	/**
	 * @Column(name="last_name", type="string", length=100, unique=false, nullable=false)
	 */
	protected $lastName;

	public function getLastName() {
		return $this->lastName;
	}
	
	/**
	 * @ManyToMany(targetEntity="Account", inversedBy="owners")
	 * @JoinTable(name="user_account",
	 *      joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")},
	 *      inverseJoinColumns={@JoinColumn(name="account_id", referencedColumnName="id")}
	 *      )
	 */
    private $accounts = null;
    
    public function getAccounts() {
    	return $this->accounts;
    }
	
}